﻿<Project 
  ToolsVersion="4.0" 
  xmlns="http://schemas.microsoft.com/developer/msbuild/2003">


  <Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>
  <Target Name="Compile">

    <MSBuild.ExtensionPack.Framework.DateAndTime TaskAction="Get" Format="yyyy">
      <Output TaskParameter="Result" PropertyName="CurrentYear"/>
    </MSBuild.ExtensionPack.Framework.DateAndTime>

    <PropertyGroup>
      <BuildFolder>$(MSBuildStartupDirectory)\..\Build</BuildFolder>
      <SolutionFolder>$(MSBuildStartupDirectory)\..\Solution</SolutionFolder>
      <SolutionFile>$(SolutionFolder)\Chord Sheet Editor for Word.sln</SolutionFile>
      
      

      <AssemblyCompany>Sanctus Software</AssemblyCompany>
      <AssemblyCopyright>Copyright © Sanctus Software 2008-$(CurrentYear)</AssemblyCopyright>
      <AssemblyMajorVersion>1</AssemblyMajorVersion>
      <AssemblyMinorVersion>0</AssemblyMinorVersion>
      <AssemblyBuildNumberType>Julian</AssemblyBuildNumberType>
      <AssemblyRevisionType>AutoIncrement</AssemblyRevisionType>
      <AssemblyRevisionFormat>00</AssemblyRevisionFormat>
      <AssemblyFileMajorVersion>$(AssemblyMajorVersion)</AssemblyFileMajorVersion>
      <AssemblyFileMinorVersion>$(AssemblyMinorVersion)</AssemblyFileMinorVersion>
      <AssemblyFileBuildNumberType>$(AssemblyBuildNumberType)</AssemblyFileBuildNumberType>
      <AssemblyFileRevisionType>$(AssemblyRevisionType)</AssemblyFileRevisionType>
      <AssemblyFileRevisionFormat>$(AssemblyRevisionFormat)</AssemblyFileRevisionFormat>

      <SignAssembly>True</SignAssembly>
      <AssemblyOriginatorKeyFile>$(MSBuildStartupDirectory)\..\..\..\..\Key\SanctusKey.snk</AssemblyOriginatorKeyFile>
      
    </PropertyGroup>

    <Message Text="---------- Information ----------"  Importance="high" />
    <Message Text="Tools Path: $(MSBuildToolsPath)" />
    <Message Text="Tools Version: $(MSBuildToolsVersion)" />
    <Message Text="Extension Path: $(MSBuildExtensionsPath)" />
    <Message Text="Startup Directory: $(MSBuildStartupDirectory)" />
    <Message Text="Extension Pack Build Path: $(BuildPath)" />
    <Message Text="Extension Task Path: $(ExtensionTasksPath)" />
    <Message Text="Build Folder: $(BuildFolder)" />
    <Message Text="Solution File: $(SolutionFile)" />

    <Message Text="---------- Clearning Build Folder ----------"  Importance="high" />
    <ItemGroup>
      <FilesToDelete Include="$(BuildFolder)\*" />
    </ItemGroup>
    <Delete Files="@(FilesToDelete)"  />

    <Message Text="---------- Setting Up AssemblyInfo ----------" Importance="high" />
    <ItemGroup>
      <AssemblyInfoFiles Include="$(SolutionFolder)\**\Properties\AssemblyInfo.cs"/>
    </ItemGroup>

    <Message Text="AssemblyInfo Files:" />
    <Message Text="@(AssemblyInfoFiles)" />

    <MSBuild.ExtensionPack.Framework.AssemblyInfo
      AssemblyInfoFiles="@(AssemblyInfoFiles)"
      AssemblyCompany="$(AssemblyCompany)"
      AssemblyCopyright="$(AssemblyCopyright)"
      AssemblyMajorVersion="$(AssemblyMajorVersion)"
      AssemblyMinorVersion="$(AssemblyMinorVersion)"
      AssemblyBuildNumberType="$(AssemblyBuildNumberType)"
      AssemblyRevisionType="$(AssemblyRevisionType)"
      AssemblyRevisionFormat="$(AssemblyRevisionFormat)"
      AssemblyFileMajorVersion="$(AssemblyFileMajorVersion)"
      AssemblyFileMinorVersion="$(AssemblyFileMinorVersion)"
      AssemblyFileBuildNumberType="$(AssemblyFileBuildNumberType)"
      AssemblyFileRevisionType="$(AssemblyFileRevisionType)"
      AssemblyFileRevisionFormat="$(AssemblyFileRevisionFormat)" />

    <MSBuild  
      
      Projects="$(SolutionFile)"  
      Properties="OutputPath=$(BuildFolder);SignAssembly=$(SignAssembly);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile)" />

  </Target>

</Project>